﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LJLNet;
using System.Text;
using System;

public class GameContext : MonoBehaviour, ISocketListener
{
    public SocketTCPPeer peer { get; set; }

    private void Start()
    {
        peer = new SocketTCPPeer(this);
        peer.Connect("127.0.0.1", 6000);

        peer.OnOperationRequest(1, new Dictionary<byte, object>() { { 1, "你好" } });
    }

    private void OnDestroy()
    {
        if (peer != null)
        {
            peer.Disconnect();
        }
    }

    public void OnOperationResponse(Dictionary<byte, object> paratemers)
    {
        Debug.Log(paratemers[0].ToString());
    }

    public void OnOperationEvent(Dictionary<byte, object> paratemers)
    {
        
    }
}

